/*
 * @Description:
 * @Autor: lcz
 * @LastEditors: lcz
 * @LastEditTime: 2024-01-16 14:24:52
 */
import FormPrompt from './components/index';
function FormPromptDemo() {
  const { hasValue, handleGetHasValue } = FormPrompt.useGetFieldsValue();
  const handleInputChange = (event: any) => {
    // 当输入框内容发生变化时设置isBlocking为true
    handleGetHasValue({ input: event.target.value });
  };

  return (
    <>
      <form>
        <label>
          输入一些内容：
          <input type='text' onChange={handleInputChange} />
        </label>
        <FormPrompt hasUnsavedChanges={hasValue} />
      </form>
    </>
  );
}

export default FormPromptDemo;
